<!--  -->
<template>
<div class='login'>
  <el-card class="elcard-form" :body-style="bodyStyle">
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" label-position="left">
      <el-form-item label="输入手机号" prop="name">
        <el-input v-model="iphonenum" type="text" oninput="value=value.replace(/[^\d]/g,'')" maxLength='11'></el-input>
      </el-form-item>
      <el-form-item label="输入账号" prop="name">
        <el-input v-model="username" oninput="value=value.replace(/[^\w\.\/]/ig,'')"></el-input>
      </el-form-item>
      <el-form-item label="输入密码" prop="name">
        <el-input v-model="passwords" type="text" oninput="value=value.replace(/[^\w\.\/]/ig,'')"></el-input>
      </el-form-item>
      <el-form-item label="再次输入密码" prop="name">
        <el-input v-model="passwordsTwo" type="text" oninput="value=value.replace(/[^\w\.\/]/ig,'')"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit" :loading='loading'>注册</el-button>
        <el-button @click="backlogin">返回登录</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</div>
</template>

<script lang='ts'>

import { defineComponent } from 'vue'
import getUnloginFunction from '@/use/unlogin'

export default defineComponent({
  name: '',
  props: {
    msg: String
  },

  setup () {
    const {
      username,
      passwords,
      bodyStyle,
      iphonenum,
      passwordsTwo,
      onSubmit,
      backlogin
    } = getUnloginFunction()

    return {
      username,
      passwords,
      bodyStyle,
      iphonenum,
      passwordsTwo,
      onSubmit,
      backlogin
    }
  }
})
</script>

<style scoped lang='scss'>
.elcard-form{
  position: absolute;
  top:  50%;
  left: 50%;
  transform: translate(-50%, -40%);
  width: 400px;
  height: 500px;
}
// .elcard-form{
//   padding-top: 500px;
// }
.login{
  background-image: url(https://ftp.bmp.ovh/imgs/2021/02/8b45d71fa0e5b14e.jpg);
  background-size: cover;
}
</style>
